Skip to content

ci: support npm authenticated publishing#86

Merged
nahiyankhan merged 3 commits into
mainfrom
codex/npm-publish-auth
May 22, 2026
Merged

ci: support npm authenticated publishing#86
nahiyankhan merged 3 commits into
mainfrom
codex/npm-publish-auth

Conversation

@nahiyankhan
Copy link
Copy Markdown
Collaborator

🤖 This PR updates the Release workflow so @anarchitecture/ghost can publish through either repo-provided npm credentials or npm Trusted Publishing.

Changes:

  • Updates actions/setup-node to v6 and uses Node 24 for a modern npm CLI.
  • Publishes the package with npm publish ./packages/ghost --access public --provenance so npm OIDC/trusted publishing can work.
  • Reads the npm token from either NPM_PUBLISH_TOKEN or the conventional NPM_TOKEN GitHub Actions secret.
  • Removes the separate NODE_AUTH_TOKEN env because Changesets writes npm auth from NPM_TOKEN when a token is present.

Local verification:

  • pnpm check
  • pnpm build
  • pnpm test via pre-push, 479 tests passing
  • npm_config_cache=/private/tmp/ghost-npm-cache npm pack ./packages/ghost --dry-run --ignore-scripts

Remaining setup before merging the release PR:

  • Add a repo secret named NPM_PUBLISH_TOKEN or NPM_TOKEN containing an npm publish token for @anarchitecture/ghost; or
  • Configure npm Trusted Publishing for package @anarchitecture/ghost with owner block, repository ghost, workflow Release, and branch main.

Comment thread .github/workflows/release.yml Fixed
Copy link
Copy Markdown
Collaborator Author

🤖 Update after the latest commit: prefer adding a repo secret named GHOST_NPM_PUBLISH_TOKEN for Nahiyan’s npm token. The workflow now resolves auth in this order:

  1. GHOST_NPM_PUBLISH_TOKEN
  2. NPM_PUBLISH_TOKEN
  3. NPM_TOKEN

Using the Ghost-specific repo secret avoids depending on the existing org-level NPM_PUBLISH_TOKEN, which may not be available to this repo or may not have the right npm scope.

@nahiyankhan nahiyankhan marked this pull request as ready for review May 22, 2026 18:41
@nahiyankhan nahiyankhan merged commit 9c70d40 into main May 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants